// stores/counter.js
import {
	defineStore
} from 'pinia';

import {
	reactive
} from 'vue'; // 添加这行导入语句

export const sandTestModel = defineStore('sandBox', {
	state: () => ({
		data: reactive({})
	}),
	actions: {
		addDataKeyAndValue(key, value) {
			// 使用Vue.set添加响应式属性
			this.$set(this.data, key, value);
		},
	},
	persist: true,
});

export const sandRouter = defineStore('sandBoxRout', {
	state: () => ({
		route: reactive([])
	}),
	actions: {
		pushRouter(value) {
			// 使用Vue.set添加响应式属性
			// console.log('eeeeeeeeeeeeeeeeeeeeeeeeeee', value)
			this.route.push(value)
		},
		popRouter(value) {
			// 使用Vue.set添加响应式属性
			this.route.pop()
		},
		clearRouter(value) {
			// 使用Vue.set添加响应式属性
			this.route = []
		},
	},
	persist: true,
});